#!/bin/bash
# set -e

SH_DIR=$(dirname $0)
WS_DIR="${SH_DIR}/.."
DATE_TEXT=`date +%Y%m%d_%H%M%S`
PUSH_LOG_FILE="${WS_DIR}/log/${DATE_TEXT}_rtsp_pusher_cam.log"

# 推流
gnome-terminal -x bash -c "${WS_DIR}/build/rtsp_pusher_cam ${WS_DIR}/config/rtsp_pusher_720p.yaml > ${WS_DIR}/log/${DATE_TEXT}_rtsp_pusher_demo.log;exec bash"
sleep 30s

# 拉流
gnome-terminal -x bash -c "${WS_DIR}/build/rtsp_puller_demo ${WS_DIR}/config/rtsp_puller.yaml > ${WS_DIR}/log/${DATE_TEXT}_rtsp_puller_demo.log ;exec bash"
sleep 10s


gnome-terminal -x bash -c "${WS_DIR}/scripts/log_info.sh rtsp_pusher;exec bash"
sleep 1s
gnome-terminal -x bash -c "${WS_DIR}/scripts/log_info.sh rtsp_puller;exec bash"